/* RA0 Edition - 앵커형 게시판 스킨 (anchor_up) */
/* CSS 변수 시스템 사용 */

/* ========== 공통 ========== */
.anchor-list-container,
.anchor-view-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ==========================================
   LIST 스타일
   ========================================== */

/* 헤더 */
.board-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.board-title {
    font-family: var(--title-font-family);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--content-font-color);
    padding-right: 15px;
    position: relative;
}

.board-title::after {
    content: '//';
    font-size: 1rem;
    color: var(--accent-color);
    margin-left: 5px;
    font-weight: 300;
}

.board-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
}

.btn-write {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
    text-decoration: none;
    border: 0;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: filter 0.2s;
}

.btn-write:hover {
    filter: brightness(1.1);
}

/* 카테고리 필터 */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.cate-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.cate-btn:hover,
.cate-btn.active {
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
    border: 0;
}

/* 그리드 */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

/* 카드 */
.data-chip {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--card-bg-color);
    border-radius: var(--card-border-radius);
    overflow: hidden;
    border: 1px solid var(--card-border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
}

.data-chip:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgb(from var(--accent-color) r g b / 15%);
}

/* 썸네일 */
.chip-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s, filter 0.4s;
    filter: grayscale(100%) brightness(0.8);
}

.data-chip:hover .chip-thumb img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.1);
}

.chip-thumb .no-thumb-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* 그라데이션 오버레이 */
.chip-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, var(--black) 0%, transparent 100%);
    z-index: 1;
    opacity: 0.85;
}

/* 정보 레이어 */
.chip-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* 카테고리 뱃지 */
.chip-cate {
    font-size: 11px;
    color: var(--black);
    background: var(--accent-color);
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 700;
    align-self: flex-start;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* 제목 */
.chip-subject {
    font-family: var(--title-font-family);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin: 0;
    transition: color 0.3s ease;
}

.data-chip:hover .chip-subject {
    color: var(--accent-color);
}

/* 설명 (호버 시 나타남) */
.chip-desc {
    height: 0;
    opacity: 0;
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 0;
    line-height: 1.4;
    overflow: hidden;
    transition: all 0.3s ease;
}

.data-chip:hover .chip-desc {
    height: 40px;
    opacity: 1;
    margin-top: 10px;
}

/* 빈 상태 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
}

.btn-first {
    display: inline-block;
    padding: 12px 24px;
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
    text-decoration: none;
    border: 0;
    border-radius: 4px;
    font-weight: 600;
}

/* 페이징 */
.board-paging {
    margin-top: 40px;
    text-align: center;
}

.board-paging a,
.board-paging strong {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s;
}

.board-paging a:hover {
    background: var(--card-bg-color);
    color: var(--content-font-color);
}

.board-paging strong {
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
}

/* 검색 */
.board-search {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.board-search form {
    display: flex;
    gap: 8px;
}

.board-search select,
.board-search input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--card-bg-color);
    color: var(--content-font-color);
    font-size: 0.9rem;
}

.board-search input[type="text"] {
    width: 200px;
}

.board-search button {
    padding: 10px 16px;
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.2s;
}

.board-search button:hover {
    filter: brightness(1.1);
}


/* ==========================================
   VIEW 스타일
   ========================================== */

/* 상단 헤더 */
.view-header {
    margin-bottom: 30px;
}

.vh-category {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.vh-subject {
    font-family: var(--title-font-family);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 5px;
    color: var(--content-font-color);
}

.vh-meta {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 메인 레이아웃 */
.view-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    position: relative;
    height: calc(100vh - 250px); /* 헤더/푸터 공간 고려 */
}

/* 좌측 앵커 네비게이션 */
.anchor-nav {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100%;
    overflow-y: auto;
    padding: 20px 0;
    border-left: 2px solid var(--border-light);
    background: var(--card-bg-color);
    border-radius: var(--card-border-radius);
    backdrop-filter: blur(5px);
}

.anchor-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.anchor-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    font-size: 0.95rem;
    text-decoration: none;
}

.anchor-link:hover,
.anchor-link.active {
    color: var(--accent-color);
}

.anchor-link.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* 우측 본문 */
.view-content {
    height: 100%;
    overflow-y: auto;
    background: var(--card-bg-color);
    border-radius: var(--card-border-radius);
    backdrop-filter: blur(5px);
    padding: 50px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.view-content.no-sidebar {
    grid-column: 1 / -1;
}

/* 대표 이미지 */
/* .view-hero-image {
    margin-bottom: 40px;
}

.view-hero-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--card-border-radius);
    border: 1px solid var(--border-light);
} */

/* 섹션 */
.cont-sec {
}

.cs-title {
    font-family: var(--title-font-family);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 25px 0;
    padding-bottom: 10px;
    color: var(--content-font-color);
    display: flex;
    align-items: center;
}

.cs-title::before {
    content: '✦';
    color: var(--accent-color);
    margin-right: 10px;
    font-weight: 300;
}

.cs-body {
    font-family: var(--content-font-family);
    font-size: var(--content-font-size);
    color: var(--content-font-color);
    line-height: 1.8;
    word-break: keep-all;
}

.cs-body p {
    margin-bottom: 20px;
}

.cs-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--card-border-radius);
    border: 1px solid var(--border-light);
    margin: 30px 0;
}

.cs-body ul,
.cs-body ol {
    margin: 20px 0;
    padding-left: 25px;
}

.cs-body li {
    margin-bottom: 10px;
}

.cs-body strong {
    color: var(--accent-color);
}

/* 첨부파일 */
.view-files {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
}

.view-files h4 {
    font-size: 1rem;
    margin: 0 0 15px 0;
    color: var(--text-muted);
}

.view-files ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.view-files li {
    margin-bottom: 8px;
}

.view-files a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--content-font-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.view-files a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.view-files .file-size {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* 하단 버튼 */
.view-btn-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.btn-left,
.btn-right {
    display: flex;
    gap: 5px;
}

.btn-edit, .btn-delete, .btn-list {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    background: var(--btn-primary-bg);
    border: 0;
    color: var(--btn-primary-text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 10px;
    border-radius: var(--btn-primary-radius);
}

.btn-edit:hover,
.btn-list:hover,
.btn-delete:hover {
    background: var(--btn-accent-bg);
    color: var(--btn-accent-text);
}

/* 이전/다음 글 */
.view-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--card-bg-color);
    border: 1px solid var(--border-light);
    border-radius: var(--card-border-radius);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-prev:not(.empty):hover,
.nav-next:not(.empty):hover {
    border-color: var(--accent-color);
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.nav-subject {
    font-weight: 600;
    color: var(--content-font-color);
}

.nav-prev:not(.empty):hover .nav-subject,
.nav-next:not(.empty):hover .nav-subject {
    color: var(--accent-color);
}

.nav-prev.empty,
.nav-next.empty {
    opacity: 0.3;
    cursor: default;
}


/* ==========================================
   반응형
   ========================================== */

@media screen and (max-width: 768px) {
    .view-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .anchor-nav {
        position: relative;
        top: 0;
        border-left: none;
        border-bottom: 1px solid var(--border-light);
        margin-bottom: 30px;
        padding: 10px 0;
        overflow-x: auto;
        white-space: nowrap;
    }

    .anchor-list {
        display: flex;
    }

    .anchor-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .anchor-link.active::before {
        left: 0;
        bottom: -1px;
        top: auto;
        width: 100%;
        height: 2px;
    }

    .vh-subject {
        font-size: 1.8rem;
    }

    .cs-title {
        font-size: 1.3rem;
    }

    .chip-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .chip-desc {
        display: none;
    }

    .chip-subject {
        font-size: 0.95rem;
    }

    .board-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-write {
        margin-left: 0;
    }

    .view-navigation {
        grid-template-columns: 1fr;
    }

    .board-search form {
        flex-wrap: wrap;
    }

    .board-search input[type="text"] {
        width: 100%;
    }

    .view-btn-wrap {
        flex-direction: column;
        gap: 15px;
    }

    .btn-left,
    .btn-right {
        width: 100%;
        justify-content: center;
    }
}